Telegram Group & Telegram Channel
Time complexity in above Picture

Fibonacci Number using Dynamic Programming:

CODE:

calculated = {}

def fib(n):
if n == 0: # base case 1
return 0
if n == 1: # base case 2
return 1
elif n in calculated:
return calculated[n]
else: # recursive step
calculated[n] = fib(n-1) + fib(n-2)
return calculated[n]

Share and Support
@Python_Codes



tg-me.com/python_codes/204
Create:
Last Update:

Time complexity in above Picture

Fibonacci Number using Dynamic Programming:

CODE:

calculated = {}

def fib(n):
if n == 0: # base case 1
return 0
if n == 1: # base case 2
return 1
elif n in calculated:
return calculated[n]
else: # recursive step
calculated[n] = fib(n-1) + fib(n-2)
return calculated[n]

Share and Support
@Python_Codes

BY Python Codes




Share with your friend now:
tg-me.com/python_codes/204

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

Telegram announces Anonymous Admins

The cloud-based messaging platform is also adding Anonymous Group Admins feature. As per Telegram, this feature is being introduced for safer protests. As per the Telegram blog post, users can “Toggle Remain Anonymous in Admin rights to enable Batman mode. The anonymized admin will be hidden in the list of group members, and their messages in the chat will be signed with the group name, similar to channel posts.”

Python Codes from kr


Telegram Python Codes
FROM USA